<template>
  <div class="interract-content">
    <el-header height="207px">
      <el-row>
        <el-col :lg="2" :md="2" :sm="24" :xl="2" :xs="24"><div style="color: transparent">占位符</div></el-col>
        <el-col :lg="20" :md="20" :sm="24" :xl="20" :xs="24">
          <div class="page-top">
            <el-image class="icon-back" :src="icon_back" @click="goback"></el-image>
            <div class="txt-back" @click="goback">返回</div> <!--$router.back()-->
            <span class="txt-line">|</span>
            <span class="txt">如需开通模块请联系管理员</span>
          </div>
        </el-col>
        <el-col :lg="2" :md="2" :sm="24" :xl="2" :xs="24"><div style="color: transparent">占位符</div></el-col>
      </el-row>
    </el-header>
    <!--轮播-->
    <el-main height="500px">
      <el-row>
        <el-col :lg="2" :md="2" :sm="24" :xl="2" :xs="24">
          <div style="color: transparent">占位符</div>
        </el-col>
        <el-col :lg="20" :md="20" :sm="24" :xl="20" :xs="24">

            <div class="threeImg">
              <div class="Containt">
                <div class="iconleft" @click="zuohua" @mouseover="mouseOver1" @mouseleave="mouseLeave1" :style="active1">
                  <i class="el-icon-arrow-left"></i>
                </div>
                <!-- 'left':calleft + 'px' 是 ul 向左偏移的量 -->
                <ul :style="{'left':calleft + 'px'}"  v-on:mouseover="stopmove()" v-on:mouseout="move()">
                  <li v-for="(item,index) in superurl" :key="index">
                    <div class="box-li">
                      <el-image
                        class="box-li-img"
                        :src="item.url"
                        fit="fill" />
                      <div class="box-li-right">
                        <div class="title">{{item.title}}</div>
                        <div class="txt">{{item.txt}}</div>
                        <el-image class="ewm" :src="item.ewm" fit="fill" />
                        <div class="text"><el-image class="icon-weixin" :src="icon_weixin" fit="fill"/>{{ txt }}</div>
                      </div>
                    </div>
                  </li>
                </ul>
                <div class="iconright" @click="youhua" @mouseover="mouseOver2" @mouseleave="mouseLeave2" :style="active2">
                  <i class="el-icon-arrow-right" ></i>
                </div>
              </div>
            </div>

        </el-col>
        <el-col :lg="2" :md="2" :sm="24" :xl="2" :xs="24">
          <div style="color: transparent">占位符</div>
        </el-col>
      </el-row>
    </el-main>
  </div>
</template>
<script>
export default {
  name: "interact",
  data() {
    return {
      icon_back: require('@/assets/login_images/icon-return.png'),
      calleft:0,  //calleft是整个数据的偏移量
      active1:'',
      active2:'',

      txt:'扫码关注',
      superurl: [
        {
          url:require('@/assets/login_images/img1.png'),
          title:'互动模块名称1',
          txt:'功能升级中...',
          ewm:require('@/assets/login_images/ewm.png'),
        },{
          url:require('@/assets/login_images/img2.png'),
          title:'互动模块名称2',
          txt:'功能升级中...',
          ewm:require('@/assets/login_images/ewm.png'),
        },{
          url:require('@/assets/login_images/img3.png'),
          title:'互动模块名称3',
          txt:'功能升级中...',
          ewm:require('@/assets/login_images/ewm.png'),
        },{
          url:require('@/assets/login_images/img1.png'),
          title:'互动模块名称4',
          txt:'功能升级中...',
          ewm:require('@/assets/login_images/ewm.png'),
        }
      ],
      icon_weixin:require('@/assets/login_images/icon-weixin.png'),
    }
  },
  created() {
    this.move()
  },
  methods:{
    //返回
    goback(){
      this.$router.go(-1)
    },
    mouseOver1() {
      this.active1 = "background-color:rgba(31,45,61,.11)";
      // 操作dom 获取p标签改变其样式
    },
    // 移出
    mouseLeave1() {
      this.active1 = "";
    },
    mouseOver2() {
      this.active2 = "background-color:rgba(31,45,61,.11)";
      // 操作dom 获取p标签改变其样式
    },
    // 移出
    mouseLeave2() {
      this.active2 = "";
    },
    //移动
    move() {
      this.timer = setInterval(this.starmove, 4000)
    },
    //开始移动
    starmove() {
      // 340是根据自己图片的大小自己设置的，点击一下整体向左平移多少
      this.calleft -= 500;
      if (this.calleft < -1200) {
        this.calleft = 0
      }
    },
    //鼠标悬停时停止移动
    stopmove() {
      clearInterval(this.timer)
    },
    //点击按钮左移
    zuohua() {
      this.calleft -= 500;
      if (this.calleft < -1200) {
        this.calleft = 0
      }
    },
    //点击按钮右移
    youhua() {
      this.calleft += 500;
      if (this.calleft > 0) {
        this.calleft = -1500
      }
    },
  }
}
</script>

<style lang="scss" scoped>
/*超链接图片*/
.threeImg {
  margin-top: 100px;
  height: 500px;
  .Containt {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin: 0 auto;
    display: flex;
    .box-li{
      display: flex;
      width: 480px;
      overflow: hidden;
      .box-li-img{
        width: 200px;
        height: 400px;
        margin-right: 30px;
      }
      .box-li-right{
        width: 200px;
        display: flex;
        flex-direction: column;
        .title{
          font-size: 24px;
          font-weight: bold;
          line-height: 41px;
          color: #333333;
          margin-bottom: 10px;
        }
        .txt{
          font-size: 14px;
          font-weight: 400;
          line-height: 25px;
          height: 75px;
          color: #999999;
          margin-bottom: 50px;
          text-overflow: -o-ellipsis-lastline;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 3;
        }
        .ewm{
          width: 150px;
          height: 150px;
          margin-bottom: 10px;
        }
        .text{
          display: flex;
          align-items: center;
          font-size: 18px;
          font-weight: 400;
          line-height: 31px;
          color: #333333;
          .icon-weixin{
            width: 20px;
            height: 20px;
            margin-right: 10px;
          }
        }
      }
    }
    .iconleft {
      top: 200px;
      left: 0;
      border: none;
      outline: none;
      padding: 0;
      margin: 0;
      height: 60px;
      width: 60px;
      line-height: 60px;
      cursor: pointer;
      transition: .3s;
      border-radius: 50%;
      background-color: rgba(0,0,0,.2);
      color: #fff;
      position: absolute;
      top: 50%;
      z-index: 10;
      transform: translateY(-50%);
      text-align: center;
      font-size: 30px;
    }
    .iconright {
      top: 200px;
      right: 0;
      border: none;
      outline: none;
      padding: 0;
      margin: 0;
      height: 60px;
      width: 60px;
      line-height: 60px;
      cursor: pointer;
      transition: .3s;
      border-radius: 50%;
      background-color: rgba(0,0,0,.2);
      color: #fff;
      position: absolute;
      top: 50%;
      z-index: 10;
      transform: translateY(-50%);
      text-align: center;
      font-size: 30px;
    }
  }
}


.threeImg .Containt ul {
  margin: 0 auto;
  width: 3000px;
  position: absolute;
  left: 0px;
  height: 100%
}

.threeImg .Containt ul li {
  width: 480px;
  margin-right: 20px;
  float: left;
  list-style-type:none;
}


.interract-content {
  height: 100vh;
  background: url('~@/assets/login_images/bg_hdmk.jpg') center center fixed no-repeat;
  background-size: cover;
}
.page-top{
  display: flex;
  align-items: center;
  margin-top: 50px;
  .icon-back{
    cursor: pointer;
    width: 16px;
    height: 14px;
    margin-right: 10px;
  }
  .txt-back{
    cursor: pointer;
    font-size: 24px;
    font-weight: 400;
    line-height: 41px;
    color: #000000;
  }
  .txt-line{
    color: #ddd;
    font-size: 24px;
    font-weight: 400;
    line-height: 41px;
    margin: 0 15px;
  }
  .txt{
    font-size: 20px;
    font-weight: 400;
    line-height: 34px;
    color: #000;
    opacity: 0.47;
  }
}
</style>
